<?php
/**
 * Created by PhpStorm.
 * User: edmmss
 * Date: 2019/1/20
 * Time: 08:53
 */

namespace app\modules\visitor;


class RoleVisitor implements RoleVisitorInterface
{
    private $_visited = [];

    /**
     * className
     *
     * @date   2019/1/20
     * @author edmmss
     * @param User $role
     * @return mixed
     */
    public function visitUser(User $role)
    {
        // TODO: Implement visitUser() method.
        $this->_visited[] = $role;
    }

    /**
     * className
     *
     * @date   2019/1/20
     * @author edmmss
     * @param Group $role
     * @return mixed
     */
    public function visitGroup(Group $role)
    {
        // TODO: Implement visitGroup() method.
        $this->_visited[] = $role;
    }

    public function getVisited(): array
    {
        return $this->_visited;
    }
}